import request from './request.js'

const Key = '2eda8519bec275dec620422507c53a77'

//根据ip获取所在城市
export const getIpData = (ip) => {
  const params = { key: Key };
  if (ip) params.ip = ip; 
  const query = new URLSearchParams(params).toString();
  return request({
    method: 'GET',
    url: `ip?${query}`,
  });
}
//查询城市的adcode
export const getCityData = (address) => {
  return request({
    method: 'GET',
    url: `/geocode/geo?address=${address}&key=${Key}`, 
  })
}

